#ifndef _TIMER_8_BIT_WITH_ASYNC_H_
#define _TIMER_8_BIT_WITH_ASYNC_H_

enum WavefromGenerationModesAsyncTimer8Bit
{
	NormalWaveformGenerationAsynTimer8Bit,
	PWM_PhaseCorrectAsyncTimer8Bit,
	CTC_AsyncTimer8Bit
	FastPWM_AsyncTimer8Bit
};

enum CompareMatchOutputModesAsyncTimer8Bit
{
	NormalPortOperation_OC2_Disconnected,
	ToggleOC2onCompareMatch,
	ClearOC2onCompareMatch,
	SetOC2onCompareMatch
};

enum ClockSelectAsynTimer8Bit
{
	NoClockSourceAsynTimer8Bit,
	NoPrescaler_AsynTimer8Bit,
	Prescaler8_AsynTimer8Bit,
	Prescaler64_AsynTimer8Bit,
	Prescaler256_AsynTimer8Bit,
	Prescaler1024_AsynTimer8Bit,
	ExternalClockFallingAsynTimer8Bit,
	ExternalClockRisingAsynTimer8Bit
};




class Timer8BitAsync
{
	unsigned long int getFrequency(
				unsigned long int CLK_IO,
				unsigned long int N,
				unsigned long int OCR_n
					);


	unsigned long int getFrequencyFastPWM(
				unsigned long int CLK_IO,
				unsigned long int N
					);


	unsigned long int getFrequencyPhaseCorrectPWM(
				unsigned long int CLK_IO,
				unsigned long int N
					);


	void setForceOutputCompare(unsigned char flag);


	void setWaveformGenerationMode(unsigned char flag);


	void setCompareMatchOutputMode(unsigned char flag);


	void setClockSelect(unsigned char flag);


	void setCounter(unsigned char flag);
	unsigned char getCounter();

	void setOutputCompare(unsigned char flag);
	unsigned char getOutputCompare();

	void setAsyncAsyncTimer8Bit(unsigned char flag);

	unsigned char getUpdateBusy();

	unsigned char getUpdateBusyOutputCompare();

	unsigned char getUpdateBusyCounterControl();

	void setOutputCompareInterruptEnable(unsigned char flag);

	void setOverflowInterruptEnable(unsigned char flag);

	unsigned char getOutputCompareFlag();

	unsigned char getOverflowFlag();

	void setPrescalerReset(unsigned char flag);

};




#endif
